package com.gjy.nwpufindseats;

import com.gjy.nwpufindseats.R;
import com.gjy.nwpufindseats.Fragment.Fragment_webHtml;
import com.jeremyfeinstein.slidingmenu.lib.app.SlidingFragmentActivity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.TextView;

public class Activity_lost extends SlidingFragmentActivity implements OnClickListener{
		private ImageButton ivTitleBtnLeft;
		public static TextView commonTitle;
		@Override
		public void onCreate(Bundle savedInstanceState) {
			super.onCreate(savedInstanceState);
			setBehindContentView(R.layout.main_left_layout);	//由于是对SlidingFragmentActivity的继承，必须由此代码		
			getSlidingMenu().setBehindWidth(0);//滑动为0，即禁止左滑
			// 支持进度条显示
			getWindow().requestFeature(Window.FEATURE_PROGRESS);
			setContentView(R.layout.activity_main);
			
			selectItem();
			setContentView(R.layout.activity_lost);
			commonTitle = (TextView) findViewById(R.id.ivTitleName);
			commonTitle.setText("失物招领");
			ivTitleBtnLeft = (ImageButton)this.findViewById(R.id.ivTitleBtnLeft);
			ivTitleBtnLeft.setOnClickListener(this);
		}		
		public void onClick(View v) {
			switch (v.getId()) {
				case R.id.ivTitleBtnLeft:
					onBackPressed();
					break;
				default:
				break;
			}		
		}
		
		private void selectItem() {
			// update the main content by replacing fragments
			Fragment fragment = new Fragment_webHtml();
			getSupportFragmentManager()
	         .beginTransaction()
	         .replace(R.id.frame, fragment)
	         .commit();
		}
		
}



